home *** CD-ROM | disk | FTP | other *** search
Makefile | 1995-05-03 | 4.3 KB | 152 lines |
- DESTDIR=/usr/skunk
- #!/bin/make -f
-
- # Copyright (c) 1986, Greg McGary
- # @(#)makefile 1.3 86/11/06
-
- # --------------------------------------------------------------------
- # System Dependent Configuration:
- # Choose a pre-packaged set of options below, or roll your own.
- # The relevant options are as follows:
- #
- # * If you have the `PW' library which includes the regular-expression
- # funcions regcmp(3) and regex(3), then use `-DREGEX' in DEFS, and
- # `-lPW' in LIBS. If you have the regular-expression functions
- # re_comp(3) and re_exec(3), use `-DRE_EXEC' in DEFS. If you don't
- # have any regular-expression functions, don't add either to DEFS.
- #
- # * If you have the POSIX compatible directory reading routines (the
- # struct dirent ones), define -DDIRENT in DEFS. Otherwise it is
- # assumed you have the 4.2 (struct direct) routines
- #
- # * If you do not have the 4.2 directory access libraries, add `-lndir'
- # to LIBS, and define `-DNDIR' in DEFS.
- #
- # * If your string libraries have index(3) and rindex(3) instead of
- # strchr(3) and strrchr(3), use `-DRINDEX' in DEFS.
- #
- # * If your compiler chokes on pointers to functions returning void,
- # use `-Dvoid=int' in DEFS.
- #
- # * If you have setlinebuf(3) in your stdio to set line-buffering on
- # a stream, use `-DERRLINEBUF' in DEFS.
- #
- # * If you have a System-III/V terminal driver, define `TERMIO' in DEFS.
- #
- # * If you have ranlib(1), define `RANLIB' as such. If you don't have
- # it, set `RANLIB' to something harmless like `@:', or `echo'
- # --------------------------------------------------------------------
-
- DEFS = -DREGEX -DDIRENT -DTERMIO # typical System-V defs
- # DEFS = -Dvoid=int -DRINDEX -DRE_EXEC -DNDIR # typical V7 defs
- # DEFS = -Dvoid=int -DRINDEX -DRE_EXEC -DERRLINEBUF # BSD defs
-
- LIBS = -lPW -lc_s
- # LIBS = -lndir -lPW # typical System-V libs
- # LIBS = -lndir # typical V7 libs
- # LIBS = # typical BSD libs (none)
-
- RANLIB = @: # system doesn't have ranlib (Sys-V)
- # RANLIB = ranlib # system has ranlib (typically V7 & BSD)
-
- # --------------------------------------------------------------------
- # Compilation / Loading options:
- # Choose options to generate a system as an installed product,
- # for debugging, or for performance profiling.
- # --------------------------------------------------------------------
-
- # CCFLG = -g -DDEBUG # debugging
- # CCFLG = -p # profiling
- CCFLG = -O # production
-
- # LDFLG = -g # debugging
- # LDFLG = -p # profiling
- LDFLG = -s # production
-
- # --------------------------------------------------------------------
-
- SHELL = /bin/sh
- TARGETS = libid.a $(PROGS) $(LIDLINKS)
- PROGS = mkid lid idx fid
- DESTINATION_DIR = $(DESTDIR)/bin
-
- LIDLINKS = gid aid eid
- CFLAGS = $(CCFLG) -I. $(DEFS)
- LDFLAGS = $(LDFLG) libid.a $(LIBS)
-
- OFILES = init.o getscan.o scan-c.o scan-asm.o bsearch.o hash.o \
- bitops.o basename.o gets0.o getsFF.o paths.o opensrc.o \
- stoi.o uerror.o document.o bitcount.o wmatch.o bitsvec.o \
- tty.o bzero.o
-
- MANPAGES = mkid.1 lid.1 aid.1 eid.1 gid.1
-
- # --------------------------------------------------------------------
-
- all: $(TARGETS)
-
- libid.a: $(OFILES)
- ar rv $@ $?
- $(RANLIB) $@
-
- mkid: mkid.o libid.a
- $(CC) -o $@ $@.o $(LDFLAGS)
-
- fid: fid.o libid.a
- $(CC) -o $@ $@.o $(LDFLAGS)
-
- lid: lid.o libid.a
- $(CC) -o $@ $@.o $(LDFLAGS)
-
- idx: idx.o libid.a
- $(CC) -o $@ $@.o $(LDFLAGS)
-
- $(LIDLINKS): lid
- -/bin/rm -f $@
- ln lid $@
-
- install: $(PROGS)
- cp $(PROGS) $(DESTINATION_DIR)
- ( cd $(DESTINATION_DIR) ; \
- for prog in $(LIDLINKS) ; do \
- ln lid $$prog ; \
- done \
- )
-
- inst-man: $(MANPAGES)
- scoinst -c -m 444 mkid.1 $(DESTDIR)/man/man.1
- # (cd $(DESTDIR)/catman/u_man/man1 ; \
- # rm -f gid.1.Z lid.1.Z aid.1.Z eid.1.Z ; \
- # touch gid.1.Z ; \
- # ln gid.1.Z lid.1.Z ; \
- # ln gid.1.Z aid.1.Z ; \
- # ln gid.1.Z eid.1.Z \
- # )
- scoinst -c -m 444 gid.1 $(DESTDIR)/man/man.1
- # (cd $(DESTDIR)/man/u_man/man1 ; \
- # rm -f lid.1 aid.1 eid.1 ; \
- # ln gid.1 lid.1 ; \
- # ln gid.1 aid.1 ; \
- # ln gid.1 eid.1 \
- # )
-
- clean clobber:
- rm -f $(TARGETS) *.o
-
- id.tar:
- cd ..; tar cvbf 20 id/id.tar id/*.[ch1-8] id/makefile id/TODO id/TUTORIAL
-
- id.tar.Z: id.tar
- compress -b 14 <id.tar >id.tar.Z
-
- id.shar: id.shar-1 id.shar-2 id.shar-3
-
- id.shar-1:
- shar $(SHARFLAGS) TUTORIAL TODO makefile *.h *.[1-8] >$@
-
- id.shar-2:
- shar $(SHARFLAGS) [a-l]*.c >$@
-
- id.shar-3:
- shar $(SHARFLAGS) [m-z]*.c >$@
-